Skip to content

feat: add config.leader and document it#40

Merged
justinsgithub merged 5 commits into
DrKJeff16:mainfrom
craigmac:annotations-work
Aug 4, 2025
Merged

feat: add config.leader and document it#40
justinsgithub merged 5 commits into
DrKJeff16:mainfrom
craigmac:annotations-work

Conversation

@craigmac
Copy link
Copy Markdown
Contributor

@craigmac craigmac commented Aug 3, 2025

Config.leader was missing, I added it, and used the preexisting
KeyNoAction and documented both leader and the fields 'keys' and mods'

Config.leader was missing, I added it, and used the preexisting
`KeyNoAction` and documented both leader and the fields 'keys' and mods'
@craigmac craigmac requested a review from justinsgithub as a code owner August 3, 2025 13:06
@DrKJeff16 DrKJeff16 self-requested a review August 3, 2025 20:13
@DrKJeff16 DrKJeff16 added documentation Improvements or additions to documentation missing-types Missing data types found needs-review A PR labeled with this is in need of review labels Aug 3, 2025
Comment thread lua/types/config.lua
-- recognized. Other keypresses will be swallowed and NOT passed through to the terminal.
--
-- LEADER stays active until a keypress is registered (whether it matches a key binding or not), or
-- until it has been active for the duration specified by timeout_milliseconds, at which point it
Copy link
Copy Markdown
Owner

@DrKJeff16 DrKJeff16 Aug 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible you could enclose timeout_milliseconds (and any other explicit identifier) ?

e.g. timeout_milliseconds

See Annotation Formatting in LuaLS' anotations wiki. It supports Markdown


A small example of how it should look when hovering:

WeztermTypes_Hover_Example

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I typically do, I knew I was going to miss some!

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We all miss something eventually, don't worry

Comment thread lua/types/enum/key-assignment.lua

-- You can also combine modifiers using the `|` symbol, like `"CMD|CTRL"`.
--
---@field mods? string Optional modifiers keys.
Copy link
Copy Markdown
Owner

@DrKJeff16 DrKJeff16 Aug 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you delete the inline comment for this (and any other) ---@field key? I'm trying to get rid of these for better manipulation.

For instance:

---@field mods? string Optional modifiers keys.
--BECOMES:
-- Optional modifiers keys
---@field mods? string

If you want to make that specific description stand out, I recommend you used tree - chars:

-- You can also combine modifiers using the `|` symbol, like `"CMD|CTRL"`.
-- ---
-- Optional modifiers keys
---@field mods? string

See #42 for my rationale, I'd love to hear yours

Copy link
Copy Markdown
Owner

@DrKJeff16 DrKJeff16 Aug 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@craigmac I've edited the suggestion, missed the description on top of the ---@field annotation 💀

Comment thread lua/types/init.lua

---@class LeaderKey: KeyNoAction
---@field timeout_milliseconds? integer
---@field timeout_milliseconds? integer Maximum time to wait for next key, default is 1000 ms.
Copy link
Copy Markdown
Owner

@DrKJeff16 DrKJeff16 Aug 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can reject it, but I'd suggest:

---@class LeaderKey: KeyNoAction
-- Maximum time to wait for the next key, in milliseconds.
--
-- The default is `1000`
---@field timeout_milliseconds? integer
--...

See #42 for my rationale, I'd love to hear yours

@DrKJeff16 DrKJeff16 requested review from DrKJeff16 and removed request for justinsgithub August 3, 2025 21:50
@DrKJeff16 DrKJeff16 mentioned this pull request Aug 3, 2025
@justinsgithub justinsgithub merged commit 471ae9e into DrKJeff16:main Aug 4, 2025
2 checks passed
@craigmac craigmac deleted the annotations-work branch August 4, 2025 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation missing-types Missing data types found needs-review A PR labeled with this is in need of review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants